package algorithms;


public class Recursion {
	
	static int factorial(int n) {
		if(n == 0)
			return 1;
		
		return n * factorial(n - 1);
	}
	
	static int power(int a, int x) {
		if(x == 1)
			return a;
		
		return  a * power(a, x -1);
	}
	
	public static void main(String[] args) {
		
		System.out.println(" " + factorial(3));
		System.out.println(" " + power(3, 3));
	}
}
